<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>管理员注册</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <style>
    body {
      background-color: #f5f8fa;
      font-family: 'Inter', sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      margin: 0;
    }
    .card {
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
      max-width: 400px;
      width: 100%;
    }
    .card-header {
      background-color: #0f3460;
      color: white;
      border-radius: 12px 12px 0 0;
      text-align: center;
      padding: 20px;
    }
    .card-body {
      padding: 30px;
    }
    .form-group {
      margin-bottom: 20px;
    }
    .form-control {
      border-radius: 8px;
      padding: 10px 15px;
      border: 1px solid #ddd;
    }
    .form-control:focus {
      border-color: #0f3460;
      box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.2);
    }
    .btn-primary {
      background-color: #0f3460;
      border-color: #0f3460;
      border-radius: 8px;
      padding: 10px;
      font-weight: 500;
    }
    .btn-primary:hover {
      background-color: #1a508b;
      border-color: #1a508b;
    }
    .text-danger {
      color: #e74c3c !important;
    }
    .mt-3 {
      margin-top: 15px;
    }
    a {
      color: #0f3460;
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <div class="card">
    <div class="card-header">
      <h2>管理员注册</h2>
    </div>
    <div class="card-body">
      <form method="post">
        <div class="form-group">
          <label for="username">用户名：</label>
          <input type="text" id="username" name="username" class="form-control" required>
        </div>
        <div class="form-group">
          <label for="password">密码：</label>
          <input type="password" id="password" name="password" class="form-control" required>
        </div>
        <div class="form-group">
          <label for="confirm">确认密码：</label>
          <input type="password" id="confirm" name="confirm" class="form-control" required>
        </div>
        <div class="form-group">
          <label for="invite">邀请码：</label>
          <input type="text" id="invite" name="invite" class="form-control" required>
        </div>
        <button type="submit" class="btn btn-primary w-100">注册</button>
      </form>
      <p class="text-center mt-3">已有账号？<a href="/login">返回登录</a></p>
      {% with messages = get_flashed_messages() %}
        {% if messages %}
          <div class="alert alert-danger mt-3">
            <ul class="mb-0">
              {% for message in messages %}
                <li>{{ message }}</li>
              {% endfor %}
            </ul>
          </div>
        {% endif %}
      {% endwith %}
    </div>
  </div>
</body>
</html>